package com.biostime.qdingding.modules.qd.service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.biostime.qdingding.common.service.CrudService;
import com.biostime.qdingding.modules.qd.dao.CoursesectionDao;
import com.biostime.qdingding.modules.qd.entity.Coursesection;
import com.biostime.qdingding.modules.sys.entity.User;

/**
 * 上课时间阶段Service
 * @author king
 * @version 2015-11-05
 */
@Service
@Transactional(readOnly = true)
public class CoursesectionService extends CrudService<CoursesectionDao, Coursesection> {
	
	@Override
	public List<Coursesection> findList(Coursesection entity) {
		dataScopeFilter(entity, "dsf", "id=a.center_id", "id=a.create_by");
		
		return super.findList(entity);
	}

	/**
	 * 获取签到时段列表
	 * @param user
	 * @param dateNow
	 * @return
	 */
	public List<Coursesection> findListSigns(User user, Date dateNow) {
		
		return dao.findListSigns(user,dateNow);
	}
	
	
//	<!-- ————————————————————————————楚河汉界，谁敢动我的，打死! ————————————————————————————————————-->	
	public List<HashMap<String,Object>> apiGetSection(String centerId){
		return dao.apiGetSection(centerId);
	}
}
